package com.dev.base.utils;

import com.dev.DevUtils;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.Operation;
/**
 * detail: 跳转 工具类
 *
 * @author Ttt
 */
public final class SkipUtils {

    private SkipUtils() {
    }


    /**
     * 跳转方法
     * @param clazz       跳转
     */
    public static void startActivity(
            AbilitySlice clazz
    ) {
        Intent intent = new Intent();
        DevUtils.getAbilitySlice().present(clazz,intent);
    }
    public static void startNewAbility(AbilitySlice abilitySlice , String bundleName, String abilityName){
        Intent intent1 = new Intent();
        Operation operation = new Intent.OperationBuilder()
                .withBundleName(bundleName)
                .withAbilityName(abilityName)
                .withDeviceId("")
                .build();
        intent1.setOperation(operation);
        abilitySlice.startAbility(intent1);
    }


}